package jataaka.script;

import jataaka.io.WriteTextFile;
import jataaka.parser.URLParser;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;

/**
 * 
 * Creates an script based on the parsed information
 * 
 * @author Juan Carlos Cancela
 *
 */
public class ScriptCreator {

	/**
	 * executes the script creation logic
	 * @param parsedResult the parsed result
	 * @return the script to add the parsed information on the database
	 */
	public static void execute(ArrayList<ArrayList<HashMap<String, String>>> parsedResult, String neigh){
		System.out.println(parsedResult);
		try {
			WriteTextFile.createFile(URLParser.dumpMap(parsedResult), neigh);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
